home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 26 / PC Gamer IT CD 26 1-2.iso / MEDIA / NET.DXR / Internal_28.ls < prev    next >
Encoding:
Text File  |  1997-11-05  |  909 b   |  39 lines

  1. on mouseUp
  2.   writeToFile()
  3.   beep()
  4.   go("begin")
  5. end
  6.  
  7. on writeToFile
  8.   global myFile, theLocation, finalPath
  9.   if objectp(myFile) then
  10.     set myFile to 0
  11.   end if
  12.   set myFile to new(xtra("fileio"))
  13.   setFilterMask(myFile, "ALL FILES, *.*, TEXT FILES, *.TXT")
  14.   set theLocation to displayOpen(myFile)
  15.   if not voidp(theLocation) then
  16.     checkFile()
  17.   else
  18.     alert("You did not select your Web Browser.")
  19.   end if
  20.   closeFile(myFile)
  21.   set myFile to 0
  22. end
  23.  
  24. on checkFile
  25.   global myFile, theLocation, finalPath
  26.   put theLocation
  27.   set finalPath to field "OSPath"
  28.   openFile(myFile, finalPath & "BROWSER.TXT", 0)
  29.   if status(myFile) = 0 then
  30.     delete(myFile)
  31.     closeFile(myFile)
  32.   end if
  33.   put theLocation into field "BrowserSelect"
  34.   set finalPath to field "OSPath"
  35.   createFile(myFile, finalPath & "BROWSER.TXT")
  36.   openFile(myFile, finalPath & "BROWSER.TXT", 0)
  37.   writeString(myFile, theLocation)
  38. end
  39.